package aspects;

import exceptions.StringVacioException;

public aspect ValidarStringNoVacio {
	
	pointcut stringSetter(String newValue): set(String clases..*) && args(newValue) ;
	
	void around(String unString): stringSetter(unString){
		if(this.validar(unString)) {throw new StringVacioException("El string estaba vac�o");}
		
		else {proceed(unString);}
	}
	
	Boolean validar (String unString){
		return unString.trim().length() < 1;
	} 
	
}